package com.nullpointer.playerinfo.bukkit.objects;

import org.bukkit.scheduler.BukkitRunnable;

import com.nullpointer.playerinfo.common.objects.Player;

public class BukkitTimer extends BukkitRunnable{

    private Player player;
    private int seconds;
    private int totalSeconds;


    public BukkitTimer(Player player) {
        this.player = player;
        this.seconds = player.getOnlineTime();
        this.totalSeconds = player.getTotalOnlineTime();
    }

    @Override
    public void run() {
        seconds++;
        totalSeconds++;
        player.setOnlineTime(seconds);
        player.setTotalOnlineTime(totalSeconds);
    }
    
}
